package org.mobai.flow.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Administrator
 */
@Getter
@AllArgsConstructor
public enum NobodyTypeEnum {
    PASS("pass", ""),
    REFUSE("refuse", ""),
    ADMIN("admin", ""),
    USER("user", ""),
    ASSIGN("assign", ""),
    ;
    private final String type;
    private final String value;

    private static final Map<String, NobodyTypeEnum> NOBODY_TYPE_ENUM_MAP = new HashMap<>();

    static {
        for (NobodyTypeEnum value : NobodyTypeEnum.values()) {
            NOBODY_TYPE_ENUM_MAP.put(value.getType(), value);
        }
    }

    public static NobodyTypeEnum getByType(String type) {
        return NOBODY_TYPE_ENUM_MAP.get(type);
    }
}
